<?php
class XAnnotationPointcut extends XAbstractPointcut{
	public function match($class, $method){
		$match = array();
		if(!preg_match("/^annotation\((.+)\)/i", $this->pattern, $match)){
			return false;
		}
		$annotation = XAnnotation::singleton($class);
		if(!is_null($annotation->get($match[1]))){
			return true;
		}
		$methodAnnotation = $annotation->method($method);
		if(is_array($methodAnnotation)
			&& isset($methodAnnotation[$match[1]])){
			return true;
		}
		return false;
	}
}
?>